<template>
  <avue-crud
    :data="data"
    :option="option"
    v-model="form"
    :page.sync='page'
  ><template
      slot-scope="{type,size}"
      slot="menu"
    >
      <el-button
        icon="el-icon-check"
        :size="size"
        :type="type"
      >当前相关项目</el-button>
      <el-button
        icon="el-icon-check"
        :size="size"
        :type="type"
      >修改记录</el-button>
    </template>
    <template slot="header">
      <el-button
        class="iconfont"
        type="danger"
        size="mini"
        plain
      >&#xe718;删除</el-button>
      <el-button
        class="iconfont"
        type="danger"
        size="mini"
        plain
      >&#xeb48;打印条码</el-button>
    </template>
  </avue-crud>
</template>

<script>
import '../assets/icon/iconfont.css'

export default {
  data () {
    return {
      form: {},
      page: {
        pageSize: 20,
        pagerCount: 5
      },
      data: [{
        barcode: 'DUEJ83648364442454',
        PdN: 'AJC1013010A/85',
        date: '2018-02-27 13:08',
        name: '接地螺母M12',
        Fcn: 'DUEJ83648364442454',
        LMt: '2018-02-27 13:13',
        state: '入库'
      }, {
        barcode: 'DUEJ83648364442454',
        PdN: 'AJC1013010A/85',
        date: '2018-02-27 13:08',
        name: '接地螺母M12',
        Fcn: 'DUEJ83648364442454',
        LMt: '2018-02-27 13:13',
        state: '放库'
      }],
      option: {
        searchMenuSpan: 6,
        card: true,
        page: true,
        selectClearBtn: false,
        menuWidth: 300,
        addBtn: false,
        delBtn: false,
        align: 'center',
        menuAlign: 'center',
        index: true,
        selection: true,
        column: [
          {
            label: '工艺文件编号',
            prop: 'PdN'
          },
          {
            label: '文件名',
            prop: 'name',
            search: true,
            type: 'input'
          },
          {
            label: '文件条码',
            prop: 'barcode'
          },
          {
            label: '所在文件柜编号',
            prop: 'Fcn'
          },
          {
            label: '创建时间',
            prop: 'date'
          },
          {
            label: '最后修改时间',
            prop: 'LMt'
          },
          {
            label: '状态',
            prop: 'state',
            search: true,
            type: 'select',
            dicData: [{
              label: '入库',
              value: '入库'
            }, {
              label: '放库',
              value: '放库'
            }]
          }
        ]
      }
    }
  }
}
</script>
